@extends('layouts.supervisor')

@section('content')
<div class="page-content">

	<div class="row">

		<div class="col-xs-12">

			<h3 class="header smaller lighter blue">学生任务书列表</h3>

			<div class="table-responsive">

				<table id="sample-table-2" class="table table-striped table-bordered table-hover">
					<thead>
						<tr>
							<th>学生姓名</th>
							<th>查看任务书</th>
							<th>审核结果</th>
							<th> 操作 </th>
						</tr>
					</thead>
					<tbody>
						@foreach($approvedStudents as $approvedStudent)
						<tr>
							<td>
								<a href="/supervisor/thesis/checkdescription/{{$approvedStudent->id}}">{{$approvedStudent->user->name}}</a>
							</td>
							<td>
								@if ($approvedStudent->description->count() > 0) 
									<a href="/download/descriptions/{{$approvedStudent->description->last()->description}}">{{$approvedStudent->description->last()->description}}</a> 
								@else
									该学生还未提交任务书，TA电话：{{$approvedStudent->user->phone}}
								@endif
							</td>
							<td>
								@if ($approvedStudent->thesis != null) 
									@if ($approvedStudent->thesis->description_approved)
									审核通过
									@else
									等待评阅
									@endif
								@endif
							</td>
							<td>
								<button class="btn btn-pink btn-sm" onclick="window.location.href='/supervisor/thesis/checkdescription/{{$approvedStudent->id}}'">
												<i class="icon-edit"></i>
												评阅
								</button>
							</td>
						</tr>
						@endforeach
					</tbody>
				</table>
	
			</div>
			
		</div>

	</div>
</div>
@endsection
